/*
 * @Description:
 * @version:
 * @Author: sunqian_sr
 * @Date: 2023-01-30 11:51:27
 * @LastEditors: Andy
 * @LastEditTime: 2023-03-07 17:02:29
 */
import { Http } from '@/common/api'

const headers = {
  headers: {
    Authorization: 'Basic c3dhcm06c3dhcm0='
  }
}

export const apiPostLogin = async (params) => Http.post('/upms/oauth2/token', params, headers)

export const apiGetLogout = async () => Http.get('/upms/token/logout')
export const apiGetUserPowers = async () => Http.get('/upms/user/findCurrentUserInfo')

export const apiGetRouter = async () => Http.get('/upms/menu/findRouters')

export const apiGetImage = async () => Http.get('/upms/captcha/image')

export const apiGetMobileCode = async (params) => Http.get('/upms/captcha/sms', params)

export const apiGetUnReadCount = async () => Http.get('/msg/ws/receiver/unreadCount')

export const apiPutFogetPwd = async (params) => Http.put('/upms/user/forgetPwd', params)

export const apiPostRegister = async (params) =>
  Http.post(`/srm/supplier/register?captcha=${params.captcha}&captchaKey=${params.captchaKey}`, params)

export const apiPostNoticePage = async (data) => Http.post('/upms/notice/supplier/page', data)

export const apiGostLoginPageCount = async () => Http.get('/srm/supplier/loginPageCount')

/**
 * 根据ID查询公告
 * @param id
 * @return {*|Promise}
 */
export const apiGetNotice = async (id) => Http.get(`/upms/notice/supplier/findById/${id}`)
